# from common.base_model import BaseModel, BasicModelMixin
# from exts import db
# from common import constant
#
#
# class Warehouse(BasicModelMixin, db.Model, BaseModel):
#     __tablename__ = 'warehouse'
#
#     id = db.Column(db.Integer, primary_key=True)
#     name = db.Column(db.String(constant.MIDDLE_DB_STR_LEN), nullable=False)
#     creator_id = db.Column(db.Integer, db.ForeignKey('user.id'))
#
#     __table_args__ = (
#         db.UniqueConstraint('name', ),
#     )
#
#
# class WarehouseRecord(BasicModelMixin, db.Model, BaseModel):
#     __tablename__ = 'storage_record'
#
#     id = db.Column(db.Integer, primary_key=True)
#     sku_id = db.Column(db.Integer, db.ForeignKey('sku.id'))
#     sku = db.relationship("Sku")
#     warehouse_id = db.Column(db.Integer, db.ForeignKey("warehouse.id"))
#     warehouse = db.relationship("Warehouse")
#     num = db.Column(db.DECIMAL(20, constant.COMMON_DECIMAL), default=0)
#
#     # 库存成本单价(当前值)
#     cost_price = db.Column(db.DECIMAL(20, constant.COMMON_DECIMAL), default=0)
#
#     __table_args__ = (
#         db.UniqueConstraint('sku_id', 'warehouse_id'),
#     )
#
#
# class WarehouseFlow(BasicModelMixin, db.Model, BaseModel):
#     __tablename__ = 'storage_flow'
#
#     id = db.Column(db.Integer, primary_key=True)
#
#     sku_id = db.Column(db.Integer, db.ForeignKey('sku.id'))
#     sku = db.relationship("Sku")
#     warehouse_id = db.Column(db.Integer, db.ForeignKey("warehouse.id"))
#     warehouse = db.relationship("Warehouse")
#
#     before_num = db.Column(db.DECIMAL(20, constant.COMMON_DECIMAL), default=0)
#     after_num = db.Column(db.DECIMAL(20, constant.COMMON_DECIMAL), default=0)
#
#     order_type = db.Column(db.String(constant.MIDDLE_DB_STR_LEN), nullable=False, default=constant.OrderType.PURCHASE)
#     order_id = db.Column(db.Integer)
